from tkinter import*

Root = Tk()
Root.title("ИТ марафон")
Root.geometry("500x500")


Canvas = Canvas(bg="white", width=500, height=500)
Canvas.pack(anchor=CENTER, expand=1)



x = int(input("x = ") )
y = int(input("y = ") )
k = float (input("k = ") )

if k== 0 and x<=500 and y>=0 and y<=500:
   pass
else:
    if k > 0 and 0*k+x>=0 and 0*k+y>=0 and 20*k+x<=500 and 20*k+y<=500:
        pass
    else:
        if k < 0 and 20*k+x>=0 and 20*k+y>=0 and 0*k+x<=500 and 0*+y<+500:
            pass
        else:
            print('размер фигуры превышает максималийный размер поля ')
            exit()
Canvas.create_rectangle(0  + x, 0 + y, (50 * k  + x ),(100 * k +  y ),fill="pink",outline="pink")
Canvas.create_rectangle((50 * k + x), (50 * k + y), (100 * k + x ), (150 * k + y),fill="pink",outline="pink")



Root.mainloop()
